<extend name="public@base5"/>
<block name="main">
    <div class="wrap js-check-wrap">
        <ul class="nav nav-tabs">
            <li class="nav-item">
                <a class="nav-link active" href="{:url('Nav/index')}">{:lang('ADMIN_NAV_INDEX')}</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="{:url('Nav/add')}">{:lang('ADMIN_NAV_ADD')}</a>
            </li>
        </ul>
        <form action="" method="post" class="margin-top-20">
            <php> $is_main=array("1"=>lang('YES'),"0"=>lang('NO'));</php>
            <table class="table table-hover table-bordered">
                <thead>
                <tr>
                    <th width="40">ID</th>
                    <th>{:lang('Name')}</th>
                    <th>{:lang('Main Navigation')}</th>
                    <th>{:lang('Description')}</th>
                    <th width="120">{:lang('ACTIONS')}</th>
                </tr>
                </thead>
                <tbody>
                <foreach name="navs" item="vo">
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.name}</td>
                        <td>
                            <empty name="vo.is_main">
                            <span class="badge text-bg-secondary">
                                {$is_main[$vo.is_main]}
                            </span>
                                <else/>
                                <span class="badge text-bg-success">
                                {$is_main[$vo.is_main]}
                            </span>
                            </empty>
                        </td>
                        <td>{$vo.remark}</td>
                        <td>
                            <a class="btn btn-xs btn-primary"
                               href="javascript:parent.openIframeLayer('{:url('NavMenu/index',array('nav_id'=>$vo['id']))}','{$vo.name} {:lang('Sub Navigations')}',{});"
                               title="{:lang('Sub Navigations')}"
                               data-toggle="tooltip">
                                <i class="fa fa-list fa-fw"></i>
                            </a>
                            <a class="btn btn-xs btn-success"
                               href="{:url('Nav/edit',array('id'=>$vo['id']))}"
                               title="{:lang('EDIT')}" data-toggle="tooltip">
                                <i class="fa fa-edit fa-fw"></i>
                            </a>
                            <a class="btn btn-xs btn-danger js-ajax-delete" href="javascript:void(0);"
                               data-href="admin/navs/{$vo.id}"
                               title="{:lang('DELETE')}"
                               data-toggle="tooltip">
                                <i class="fa fa-trash fa-fw"></i>
                            </a>
                        </td>
                    </tr>
                </foreach>
                </tbody>
            </table>
        </form>
    </div>
</block>
